<style>
 span.publish {
    background-image: url("/images/admin/tick.png");
}
span.state {
    display: inline-block;
    height: 16px;
    width: 16px;
}
</style>
<script language="javascript">
   $(document).ready(function() {
    $('#blogtable').dataTable( {
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
     "aaSorting": [[ 0, "desc" ]]
    } );
} );

</script>
<?php
if($this->stat == "added")
{
?>
	<div id="success_msg">Blog successfully saved</div>
<?php
} else if ($this->stat == "updated") {
?>
	<div id="success_msg">Blog successfully updated</div>
<?php
} else if ($this->stat == "deleted") {
?>
	<div id="success_msg">Blog successfully deleted</div>
<?php
}
?>
<?php
echo $this->adminToolBar('blog', 'index', '/admin/blog/add/', '/admin/blog/edit/', '/admin/blog/delete/', '');
?>  
<table id="blogtable" width="100%" class="adminlist">
	<thead>
		<tr>                 
			<th>Title</th>
			<th>Status</th>
			<th>Category</th>
			<th>Access</th>
			<th>Created BY</th>
			<th>Date</th>
			<th>Hits</th>
			<th>ID</th>
			<th>&nbsp;</th>
			<th>&nbsp;</th>
		</tr>
	</thead>              
    <tbody>
		<?php foreach($this->blogarr as $blogarr):	
			if($blogarr['state'] == 1)
			{
				$status = "<img src='/images/admin/publish.png' title='unpublish' />";
			} else {
				$status = "<img src='/images/admin/publish_x.png' title='publish' />";
			}
		?>
		<tr>                
        	<td><a href="/admin/blog/edit/id/<?php echo $blogarr["id"] ?>"><?php echo $blogarr["title"] ?></a><br>Alias : <?php echo $blogarr["alias"] ?></td>
			<td><a href="javascript: void(0);" onclick="changeBlogStatus('<?php echo $blogarr['id']; ?>')"><?php echo $status; ?></a></td>
			<td><?php echo $blogarr["catid"] ?></td>
			<td><?php echo $blogarr["access"] ?></td>
			<td><?php echo $blogarr["created_by"] ?></td>
			<td><?php echo $blogarr["publish_up"] ?></td>
			<td><?php echo $blogarr["hits"] ?></td>
			<td><?php echo $blogarr["id"] ?></td>
			<td><a href="/admin/blog/edit/id/<?php echo $blogarr["id"] ?>"><img src="/images/admin/icons/edit.gif" width="15" height="15" /></a></td>
			<td><a href="javascript: void(0);" onclick="deleteBlogs('<?php echo $blogarr['id']; ?>')"><img src="/images/admin/icons/delete.gif" width="18" height="18" /></a></td>
		</tr>      
		<?php endforeach;?>
	</tbody>
</table>